package 字节码文件;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 类加载 成员变量的显示赋值 在构造器中赋值 不是中间 而是调用构造器的第一行代码后 “ public Son() {” 开始为成员变量显示赋值
 * <P> Date: 2022/3/24:22:09
 * <P> Description:
 */

public class ClassInint {
    public static void main(String[] args) {
        Father father = new Son();
        //属性不存在多态性
        System.out.println(father.x);
        Integer a = 1;
        Integer b = new Integer(1);
        int  c = 1;
        System.out.println(new Integer(1) == new Integer(2));
        System.out.println(a == b);
        System.out.println(a == c);
        System.out.println(b == c);
//        Son son = (Son) father;
//        System.out.println(son.x);
    }
}

class Father{
      int x = 10;

    public Father() {
        this.print();
        x = 20;
    }

    public void print(){
        System.out.println("Father.print"+x);
    }
}

class Son extends  Father{
      int x = 30;

    public Son() {
        this.print();
        x = 40;
    }
    @Override
    public void print(){
        System.out.println("Son.print" + x);
    }
}

